from django.http import *
from django.template import loader


def hello(request, num1, cal, num2):
    res = 0
    if cal == 'add':
        res = num1 + num2
    elif cal == 'mul':
        res = num1 * num2
    elif cal == 'minus':
        res = num1 - num2
    else:
        resp = HttpResponse('request error')
        resp.status_code = 400
        return resp
    return HttpResponse("您当前%d岁" % res)


def pages(request, path):
    t = loader.get_template('index.html')
    return HttpResponse(t.render())
